package org.zht.dormpro.auth.mapper;

import org.apache.ibatis.annotations.*;
import org.zht.dormpro.auth.bean.PageBean;
import org.zht.dormpro.auth.model.SysUser;

import java.util.List;

public interface SysUserMapper {
    @Delete({"delete from sys_user where id = #{id,jdbcType=INTEGER}"})
    int deleteByPrimaryKey(Integer id);

    int insertSelective(SysUser record);

    @Select({"select",
        "id, usercode, username, password, email, salt, locked, dept_id, create_time, ",
        "modify_time, creator, mender, user_append",
        "from sys_user",
        "where id = #{id,jdbcType=INTEGER}"})
    @ResultMap("org.zht.dormpro.auth.mapper.SysUserMapper.BaseResultMap")
    SysUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysUser record);

    SysUser getSysUserByUserCode(String id);

    List<SysUser> selectByCondition(PageBean pageBean);
    @Update("update sys_user set `password`=#{realPwd} where id = #{id}" )
    Long resetPassword(@Param("id") Integer id,@Param("realPwd") String realPwd);
}